﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;

namespace Beetle.Web.UI.WebControls
{
    public sealed class SearchItemDropDownList : SearchItemBase
    {
        protected override void RenderContent(System.Web.UI.HtmlTextWriter writer)
        {
            if (this.DefaultValue != null)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Value, this.DefaultValue);
            }

            this.ReaderValueFieldId(writer);
            writer.RenderBeginTag(HtmlTextWriterTag.Select);
            writer.AddAttribute(HtmlTextWriterAttribute.Value, "Man");
            if (this.DefaultValue == "Man")
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Selected, "true");
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Option);
            writer.Write("男");
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Value, "Female");
            if (this.DefaultValue == "Female")
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Selected, "true");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Option);
            writer.Write("女");
            writer.RenderEndTag();
            writer.RenderEndTag();
        }
        

        public override object Clone()
        {
            SearchItemDropDownList clone = new SearchItemDropDownList();
            return base.Clone(clone);
        }
    }
}
